package org.lhy.hubuoj.judge;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.lhy.hubuoj.judge.model.ExecuteCodeRequest;
import org.lhy.hubuoj.judge.model.ExecuteCodeResponse;

/**
 * 代码沙箱代理类
 *
 * @author 没天赋
 * @since 2025-04-06
 */
@AllArgsConstructor
@Slf4j
public class CodeSandBoxProxy implements CodeSandBox{

    private CodeSandBox codeSandBox;

    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱请求信息：{}",executeCodeRequest.toString());
        ExecuteCodeResponse executeCodeResponse = codeSandBox.executeCode(executeCodeRequest);
        log.info("代码沙箱响应信息：{}", executeCodeResponse.toString());
        return executeCodeResponse;
    }
}
